home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / ptv1n4.arc / TSR101.ASM < prev    next >
Assembly Source File  |  1990-09-13  |  812b  |  25 lines

  1.  
  2. OLD_INT_16 DD 0    ; TSR install stores old INT 16H vector here.
  3.     ...
  4.     ...
  5.     ...
  6. NEW_INT_16:        ; TSR install points INT 16H vector to here.
  7.     STI
  8.     CMP     AH,00H        ; Request = 00H (get keystroke)?
  9.     JE      CALL_BIOS     ; ..yes, then CALL BIOS
  10.                               ;   (and then back to us)
  11.     JMP     CS:OLD_INT_16 ; ..no, just JMP to BIOS
  12.                               ;   (it'll IRET to user)
  13. CALL_BIOS:
  14.     PUSHF      ; Simulate INT so BIOS's IRET returns to us
  15.     CALL    CS:OLD_INT_16 ; call BIOS INT 16H handler
  16.                   ; now we're back...
  17.     PUSHF                 ; Save any flags from the BIOS routine
  18.     CMP     AX,CS:HOT_KEY ; Is it our hot key?
  19.     JE      TSR_MAINLINE  ; ..yes, go do the TSR's thing
  20.     POPF                  ; ..no,  go back to user...
  21.     IRET
  22.     ...
  23.     ...
  24.  
  25.